Alpha blending is used in graphics and image processing. Generally, pixel data of a single pixel used in graphics includes four components: a red component; a blue component; a green component; and, an alpha component. The alpha component can specify a transparency of the pixel. For example, the alpha component can be used to specify how much of a background is visible through a foreground object. The alpha value can also be used to apply particular textures to an object or surface in a graphics image. The alpha value is applied to each of the color components to combine a current pixel of a foreground object to an overlaid pixel, such as to pixels of a background object. The alpha value generally represents a value from 0 to 1, wherein a value of ‘0’ indicates only a pixel from the background object is visible; while, a value of ‘1’ indicates only a pixel from the foreground object is visible. For example, a foreground pixel having a red component, RSRC, a blue component, BSRC, a green component, GSRC, and an alpha, α, is converted into a new pixel having a red component, RNEW, a blue component, BNEW, and a green component, GNEW, using the following equations:RNEW=RSRC(α)+RBGD(1−α);BNEW=BSRC(α)+BBGD(1−α); andGNEW=GSRC(α)+GBGD(1−α).The values of RBGD, BBGD, and GBGD represent red green and blue components, respectively, in a background pixel being blended with the foreground, or source pixel.
The alpha value is applied to all of the color components of a pixel. It may be desired to enhance a particular color of an object for blending. For example, a color may be associated with a particular texture to be applied. It may also be desired to represent a filtering of particular colors to represent a colored glass or particular atmospheric effects in graphics. The color components must be individually enhanced prior to alpha blending to allow the desired effects to be represented. Extra processing must be performed to enhance color components for a blending operation.
From the above discussion, it should be appreciated that an improved method of blending is needed.